<!doctype html>
<html>
<head><base href="/">
<meta charset="utf-8">
<title>layui.form小例子</title>
<link rel="stylesheet" href="js/layui/css/layui.css"  media="all">
</head>
<body><!-- style="background-color: #F2F2F2;" -->
#include("/WEB-INF/_system/common/layui_control.html")
<form  id="form" class="layui-form layui-form-pane"> <!-- 提示：如果你不想用form，你可以换成div等任何一个普通元素 -->
<div  class="layui-form-item">
    <label class="layui-form-label">表名</label>
    <div class="layui-input-inline">
    #@input("tableName","表名","|","")
    </div>
    <label class="layui-form-label">版本</label>
    <div class="layui-input-inline">
    #@input("version","版本","|","")
    </div>
  </div>
<div  class="layui-form-item">
    <label class="layui-form-label">创建时间</label>
    <div class="layui-input-inline">
    #@laytime("createTime","创建时间","|","")
    </div>
  </div>
       <div  class="layui-form-item" pane>
    <label class="layui-form-label">旧Controller</label>
    <div class="layui-input-block">
    #@umeditor("oController","旧Controller","|","")
    </div>  </div>
 <!-- <div class="layui-form-item ">
    <label class="layui-form-label">状态</label>
    <div class="layui-input-inline">
      <select name="status" lay-filter="status" lay-search>
        <option value="0">激活</option>
        <option value="1">冻结</option>
      </select>
    </div>
  </div> -->
  <div class="layui-form-item">
    <div class="layui-input-block">
      <button class="layui-btn" lay-submit lay-filter="*">立即提交</button>
      <button type="reset" class="layui-btn layui-btn-primary">重置</button>
    </div>
  </div>
  <!-- 更多表单结构排版请移步文档左侧【页面元素-表单】一项阅览 -->
</form>
<script>
layui.use(['form','layer'], function(){
  var form = layui.form();
  form.render(); //更新全部
  //各种基于事件的操作，下面会有进一步介绍
  form.on('submit(*)', function(data){
	  $.ajax({
          url:'/gLog/doadd',
          type:'POST', //GET
          data:$("#form").serializeArray(),
          timeout:5000,    //超时时间
          dataType:'json',    //返回的数据格式：json/xml/html/script/jsonp/text
          success:function(data,textStatus,jqXHR){
          parent.list(1);
          var index = parent.layer.getFrameIndex(window.name); //获取窗口索引  
          parent.layer.close(index);//关闭弹出的子页面窗口
          parent.layer.msg(data.msg, {icon: 1});
          },
          eorror:function(){
          layer.msg('网络发生错误，请联系管理员！', {icon: 2});
          }
      });
	  return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
	});
});
</script>
</body></html>